<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<title>致一年未见的你</title>
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/loadding.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="../../../js/common/common.js"></script>
<script type="text/javascript" src="../../../js/common/wechatCommon.js"></script>
<script type="text/javascript" src="js/notReturnFactorCommon.js"></script>
<script type="text/javascript" src="js/GPS_orientation.js"></script>
<style type="text/css">
body {
	background: #1fbad6;
}

.bg-pic {
	background: url(images/pic_04.png) no-repeat bottom;
	padding-top: 20px;
}

.content {
	position: relative;
	color: #fff;
}

.content>img {
	width: 100%;
	height: 100%
}

.pic-lay {
	display: block;
	margin: 0 auto;
}

.padd-content {
	width: 80%;
	padding: 0 5%;
	margin: 0 auto;
}

.main1 {
	background: url(images/bg-1.png) no-repeat;
	background-size: 100% 100%;
	padding-top: 25px;
	padding-right: 10%;
}

.main2 {
	background: url(images/bg-2.png) no-repeat;
	background-size: 100% 100%;
}

.main3 {
	background: url(images/bg-3.png) no-repeat;
	background-size: 100% 100%;
	padding-bottom: 50px;
	padding-left: 10%;
}

.por-first {
	padding-right: 40px
}

.date {
	color: #f10f18;
	font-size:16px;
	font-weight:bold;
	font-style: italic;
}
/*model 样式*/
.model {
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.9);
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1;
	display: none;
}

.model-wrap {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 280px;
	height: 280px;
	padding: 20px 10px 0;
	background: #fff;
	border-radius: 10px;
	color: #838282;
}

.close {
	position: relative;
}

.close>img {
	position: absolute;
	top: -103px;
	right: 0;
	width: 40px;
}

.model-wrap>img {
	width: 50%;
}

.btns {
	width: 98%;
	padding: 13px 0;
	margin: 0 auto;
	height: 50px;
	background: url(images/btns_bg.png) no-repeat;
	background-size: 100% 100%;
	box-sizing: border-box;
	vertical-align: middle;
}

.content-wrap-3 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	word-wrap: break-word;
}

.content-wrap-4 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	overflow: hidden;
	word-wrap: break-word;
}

.content-wrap-5 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 5;
	overflow: hidden;
	word-wrap: break-word;
}

.pic_fl {
	float: left;
}

.r_pic {
	width: 38%;
	height: 22px;
}

.r_pic>img {
	width: 100%;
	height: 100%;
}

.r_piz {
	width: 8%;
}

.r_piz>img {
	width: 100%;
}

.r_num {
	position: relative;
	left: -11px;
	top: 0;
	width: 5%;
}

.r_num>img {
	width: 100%;
	/*display: block;*/
}
</style>
</head>
<body>
<!-- 	<div id="loading" style="display: none;">
		数据正在加载....
		<img alt="loading" src="images/timg.gif">
	</div> -->
	<div class="pic">
		<img src="images/pic_01.png">
	</div>
	<div class="content">
		<div class="main main1">
			<img src="images/pic_03.png" class="width-160 pic-lay">
			<!-- <img src="images/pic_04.png" class="width-190 pic-lay"> -->
			<p class="padd-content por-first content-wrap-3">抽奖时间:<span class="date">2017/09/01-2017/09/25</span></p>
			<p class="padd-content por-first content-wrap-3">&nbsp;&nbsp;OMG!OMG!尊贵的车主,我们已经有一年未见了吧，我怪想您的，为了提升我的服务水平，您能帮我做一份问卷调查么？</p>
		</div>
		<div class="main main2">
			<p class="padd-content content-wrap-4">
				&nbsp;&nbsp;只要是一年及以上未见面的车主即可参与,更有机会抽取广汽三菱为您准备
				<span class="date">800</span>
				元高端动力系统养护套餐券哦
			</p>
		</div>
		<div class="main main3">
			<p class="padd-content por-third content-wrap-5">
				&nbsp;&nbsp;您要是中奖了,记得在2017年9月30日前和您喜欢的4S店预约,不然就失效了;高端动力系统养护套餐券的使用时间截至
				<span class="date">2017年10月31日</span>
				,您一定不要错过了哟!还有更多优惠及好玩的在店里等着您!
			</p>
		</div>
		<div class="btns" id="btns1">
			<span id="span1" class="pic_fl r_pic">
				<img src="images/btns_02.png" alt="">
			</span>
			<span class="pic_fl r_num"><img id="img0" src="images/0.png" alt=""></span>
			<span class="pic_fl r_num"><img id="img1" src="images/0.png" alt=""></span>
			<span class="pic_fl r_num"><img id="img2" src="images/0.png" alt=""></span>
			<span class="pic_fl r_num"><img id="img3" src="images/0.png" alt=""></span>
			<span class="pic_fl r_pic">
				<img src="images/btns_01.png" alt="">
			</span>
		</div>
		<div class="pic">
			<img src="images/footer.png" alt="">
		</div>
	</div>
	<div class="model">
		<div class="model-wrap">
			<div class="close">
				<img src="images/close.png">
			</div>
			<img src="images/people.png" alt="" class="block auto">
			<p>
				<img src="images/tips.png" class="width-3">
			</p>
			<p class="content-wrap-3">由于您和我经常见面，所以您不能参与此活动但我已经为您准备了更多的优惠，届时请您务必多多参与哦！</p>
		</div>
	</div>

	<script>
		$(function() {
			$('.model').hide();
			
			$('.close').on('click', function() {
				$('.model').hide();
			});
			
			$('.btns').on('click', function() {
				//alert("判断是否有资格参加活动,暂时都是有资格.");
				init();
			});
		});
		
		var rootPath = getRootPath();
		
		function init(){
			$.ajax({
				headers:{'Cookie':document.cookie},
				type:"POST", 
		        url:rootPath + "/pointActivity/api/v1/checkUserProgress",
		        //url : "http://127.0.0.1:9013/pointActivity/api/v1/checkUserProgress",
		        dataType:"json",
		        contentType:"application/json",
		        success:function(data){
		        	check(data.INIT_RESULT_TYPE);
		        }
		     });
		}
		
		function check(status){
			var url = rootPath + "/views/gmmcActivity/NotReturnFactory/";
			if(0 == status){
				showAlert("只有车主才可以参加活动.请在个人中心进行会员注册及车辆认证");
        	} else if(1 == status){
        		showAlert("抽奖活动尚未开始,敬请期待");
        	} else if(2 == status){
        		showAlert("抽奖活动已结束,更多活动.敬请关注广汽三菱服务号.祝您用车愉快");
        	} else if(3 == status){
        		$('.model').show();
        	} else if(4 == status){
        		//window.location.href = url + "answer-1.html?random=" + parseInt(10000 * Math.random());
        		$.ajax({
				headers:{'Cookie':document.cookie},
				type:"POST", 
		        url:rootPath + "/pointActivity/api/v1/questionnairIfExist",
		        //url : "http://127.0.0.1:9013/pointActivity/api/v1/checkUserProgress",
		        dataType:"json",
		        contentType:"application/json",
		        success:function(data){
		        	if(data.qId == null || data.qId == ""){
		        		showAlert("问卷生成中!");
		        	}else{
		        		window.location.replace(url + "answer-1.html?random=" + parseInt(10000 * Math.random()));
		        	}
		        }
		     });
        	} else if(5 == status){
        		//window.location.href = url + "prize.html?random=" + parseInt(10000 * Math.random());
        		window.location.replace(url + "prize.html?random=" + parseInt(10000 * Math.random()));
        	} else if(6 == status){
        		//window.location.href = url + "fail.html?random=" + parseInt(10000 * Math.random());
        		window.location.replace(url + "fail.html?random=" + parseInt(10000 * Math.random()));
        	} else if(7 == status){
        		//window.location.href = url + "extract.html?random=" + parseInt(10000 * Math.random());
        		window.location.replace(url + "extract.html?random=" + parseInt(10000 * Math.random()));
        	}
		}
	</script>
</body>
</html>
